package org.lg.utils;

public class CommandUtils {
    public static Object changeType(String target,Class clazz){
        Object result = null;
        switch (clazz.getSimpleName()){
            case "Integer":;
            case "int":
                result = Integer.parseInt(target);
                break;
            case "Float":;
            case "float":
                result = Float.parseFloat(target);
                break;
            case "String":
                result = String.valueOf(target);
                break;
                default:
                    result = target;
        }
        return result;
    }

    //首字母大写
    public static String changeFirstCharUpper(String str){
        return str.substring(0,1).toUpperCase()+ str.substring(1);
    }
    //首字母小写
    public static String changeFirstCharLower(String str){
        return str.substring(0,1).toLowerCase()+ str.substring(1);
    }
}
